#ifndef TASK_IFACE
#define TASK_IFACE

/* plugin information */
typedef struct _SPluginRegister SPluginRegister;
struct _SPluginRegister
{
  int size;
  const char *pluginName;
  const char *pluginDescription;
  const char *pluginAuthor;
  const char *pluginVersion;
  struct _STaskRegister *first;
};

/* Task registration */
typedef struct _STaskInstance * (* FN_CREATE_INSTANCE) ();
typedef bool (* FN_DESTROY_INSTANCE) (struct _STaskInstance *);

typedef struct _STaskRegister STaskRegister;
struct _STaskRegister
{
  int size;
  const char *taskName;
  const char *taskDescription;
  const char *taskAuthor;
  const char *taskVersion;
  FN_CREATE_INSTANCE fCreateInstance;
  FN_DESTROY_INSTANCE fDestroInstance;
  struct STaskRegister *next;
};

/* Task insntace */
typedef bool (* FN_READY) (struct _STaskInstance *);
typedef bool (* FN_RUN) (struct _STaskInstance *);
typedef bool (* FN_STOP) (struct _STaskInstance *);
typedef bool (* FN_PAUSE) (struct _STaskInstance *);
typedef bool (* FN_RESUME) (struct _STaskInstance *);
typedef bool (* FN_ABORT) (struct _STaskInstance *);
typedef bool (* FN_DONE) (struct _STaskInstance *);

typedef struct _STaskInstance STaskInstance;
struct _STaskInstance
{
  int size;
  void *context;
  FN_READY fReady;
  FN_RUN fRun;
  FN_STOP fStop;
  FN_PAUSE fPause;
  FN_RESUME fResume;
  FN_ABORT fAbort;
  FN_DONE fDone;
};

#endif // TASK_IFACE
